function [ all, c, ax, vx ] = MVDR_MFCC(vzorky,sr)

win = 400;            %dlzka FT
hopfactor = 0.4;      %prekrivanie
p = 60;               %rad

vzorky = filter([1 -0.97], 1, vzorky);   %preemfaza

hop = win*hopfactor;                      %prekrivanie v FT
Z = buffer(vzorky,win,win-hop);          %segemtacia
Q = size(Z,2);
hamming_okno = hamming(win);              %hamming okno
oknovane_ramce_all = [];
for q = 1:Q
    wind = Z(:,q);
    oknovane_ramce = hamming_okno.*wind;                            %oknovanie
    oknovane_ramce_all = [oknovane_ramce_all oknovane_ramce];
end

Sa_all = [];
Sp_all = [];
Sb_all = [];
for i = 1:Q,
    ramec_MVDR = oknovane_ramce_all(:,i);
    [Sa,Sb,Sp] = pmvdr_MVDR(ramec_MVDR,p);                 %MVDR 
    Sa_all = [Sa_all Sa];
    Sp_all = [Sp_all Sp];
    Sb_all = [Sb_all Sb]; 
end

y = log(Sb_all);

X = audspec_MVDR(y, sr);              %melova filtracia

c = dct(X);

nbands = size(c,1);

c(14:nbands, :) = [];
for i = 1 : 13
           c(i, : ) = c(i, : ) - mean(c(i, : ));         %CMN
end

c=c';

nf=size(c,1);
nc=13;

  vf=(4:-1:-4)/60;
  af=(1:-1:-1)/2;
  ww=ones(5,1);
  cx=[c(ww,:); c; c(nf*ww,:)];
  vx=reshape(filter(vf,1,cx(:)),nf+10,nc);
  vx(1:8,:)=[];
  ax=reshape(filter(af,1,vx(:)),nf+2,nc);
  ax(1:2,:)=[];
  vx([1 nf+2],:)=[];  
  all=[c vx ax];
  
  c=c';             %zakladne
  ax=ax';           %akceleracne
  vx=vx';           %diferencne
  all=all';         %vsetky 39

end
